import request from '@/utils/request'

const prefix = "/api/openCourse"

// 获取课程列表
export function openList(params) {
	return request({
		url: prefix + '/openCourseList',
		method: 'get',
		params: params
	})
}

// 详情
export function openInfo(id) {
	return request({
		url: prefix + '/openCourseDetails/' + id,
		method: 'get'
	})
}


// 报名
export function enroll(id) {
	return request({
		url: prefix + '/enroll/' + id,
		method: 'post'
	})
}


// 签到
export function sign(id) {
	return request({
		url: prefix + '/sign/' + id,
		method: 'post'
	})
}

//公开课报名的人员列表
export function getEnrollUserList(courseId) {
	return request({
		url: prefix + '/enrollUserList/' + courseId,
		method: 'get'
	})
}

/**
 * 公开课评论列表
 * @param params
 * @returns {AxiosPromise}
 */
export function evaluateList(params) {
    return request({
        url: prefix+`/evaluateList`,
        method: 'get',
        params: params
    })
}